package de.htwg_konstanz.infen.aufg3;

import java.util.HashMap;
import java.util.Map.Entry;
import java.util.TreeSet;

public enum DataGuideHelper {

	INSTANCE;

	public static char itemSeperator = '>';
	
	public static TreeSet<String> getAllChilds(String _key,
			HashMap<String, CustomHashMapValueItem> _dataGuide) {

		TreeSet<String> entries = new TreeSet<String>();
		for (Entry<String, CustomHashMapValueItem> item : _dataGuide.entrySet()) {
			String[] splittedPath = item.getValue().PATH.split(_key
					+ itemSeperator);
			String entry = splittedPath[splittedPath.length - 1];
			if (splittedPath.length != 1
					&& !entry.contains("" + itemSeperator))
				entries.add((splittedPath[splittedPath.length - 1]));
		}
		return entries;
	}
}
